//
//  Model.m
//  10-易车
//
//  Created by dllo on 16/7/27.
//  Copyright © 2016年LST. All rights reserved.
//

#import "Model.h"

@implementation Model
- (void)setValue:(id)value forUndefinedKey:(NSString *)key{
    
}
- (instancetype)initWithDic:(NSDictionary *)dic{
    self = [super init];
    if (self) {
        [self setValuesForKeysWithDictionary:dic];
    }
    return self;
}
+ (instancetype)modelWithDic:(NSDictionary *)dic{
    return [[Model alloc] initWithDic:dic];
}
+ (NSArray *)getDataFromPlist{
    NSDictionary *dicPlist = [NSDictionary dictionaryWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"YiChe" ofType:@"plist"]];
    NSDictionary *dicData = dicPlist[@"data"];
    NSArray *arrList = dicData[@"cycleImage"];
    NSMutableArray *arrModels = [NSMutableArray array];
    for (NSDictionary *dic in arrList) {
        [arrModels addObject:[self modelWithDic:dic]];
    }
    return arrModels;
}
@end
